<p-divider>
  <b>字段列表</b>
</p-divider>
<p-table [value]="fields"
  styleClass="p-datatable-sm field-list">
  <ng-template pTemplate="header">
    <tr>
      <th>名称</th>
      <th>是否显示</th>
      <th>描述</th>
      <th>PLC地址</th>
      <th>字段类型</th>
      <th>当前值</th>
      <th>当前描述</th>
    </tr>
  </ng-template>
  <ng-template pTemplate="body"
    let-field
    let-columns="columns"
    let-index="rowIndex">
    <tr class="field-box w-full">
      <td>
        {{field.Name}}
      </td>
      <td>
        {{field.Visible? "是" : "否"}}
      </td>
      <td>
        {{field.Description}}
      </td>
      <td>
        {{field.Address}}
      </td>
      <td>
        {{field.Type}}
      </td>
      <td>
        {{values[field.Name]}}
      </td>
      <td>
        <div [style]="{color: valueMapColor(field, values[field.Name])}">
          {{valueMapDescription(field, values[field.Name])}}
        </div>
      </td>
    </tr>
  </ng-template>
</p-table>